package test.model;

import com.google.inject.Inject;
import ms.aurora.forms.Input;
import ms.aurora.mvp.Model;
import ms.aurora.routing.Route;

import javax.swing.*;

public class DefaultModel extends Model {

    @Input(label = "Name:")
    private String name;

    @Input(label = "Occupation:", maxLength = 50)
    private String occupation;

    @Input(label = "Age:", component = JSpinner.class)
    private int age;

    @Input(label = "Dumdumdum", component = JComboBox.class)
    private String dumdumdum;

    @Inject
    public DefaultModel() {
    }

    public String getName() {
        return name;
    }

    @Route(attributeName = "name")
    public void setName(String name) {
        this.name = name;
    }

    public String getOccupation() {
        return occupation;
    }

    @Route(attributeName = "occupation")
    public void setOccupation(String occupation) {
        this.occupation = occupation;
    }

    public int getAge() {
        return age;
    }

    @Route(attributeName = "age")
    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Name: " + name + "; Occupation: " + occupation + "; Age:" + age;
    }
}
